﻿
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="util.PageManager"%>
<%@page import="util.Info"%>
<%@page import="dao.CommDAO"%>
<%@taglib prefix="s" uri="http://java.sun.com/jsp/jstl/core" %>

<%
	HashMap user = Info.getUser(request);
String uname = user.get("uname").toString();
String utype = user.get("utype").toString();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<title>无标题文档</title>
<style type="text/css">
<!--
body {
	margin: 0px;
}
-->
</style>
<link href="../admin/global.css" rel="stylesheet" type="text/css" />
<script language=javascript>
function clearNoNum(obj){
     //先把非数字的都替换掉，除了数字和.
     obj.value = obj.value.replace(/[^\d.]/g,"");
     //必须保证第一个为数字而不是.
     obj.value = obj.value.replace(/^\./g,"");
     //保证只有出现一个.而没有多个.
     obj.value = obj.value.replace(/\.{2,}/g,".");
     //保证.只出现一次，而不能出现两次以上
     obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
   } 
/* function window.onload() { 


if(top.location != self.location){ 

var a = window.parent.document.getElementsByTagName('iframe'); 

for (var i=0; i<a.length; i++){ 

if (a[i].name == self.name) {a[i].height = document.body.scrollHeight+400; return;}}} 

} */

</script>
</head>

<body>
	<form action="members.jsp" name="f1" method="post">
		<table width="100%" border="0" cellpadding="0" cellspacing="0"
			bgcolor="#FFFFFF" class="main_table_frame">
			<tr>
				<td height="136"><table width="100%" border="0" cellpadding="0"
						cellspacing="0" bgcolor="#F7F7F7" class="main_desk_table">
						<tr>
							<td width="8%" height="6"></td>
						</tr>
						<tr>
							<td><table width="100%" border="0" cellpadding="0"
									cellspacing="0" bgcolor="#F7F7F7">
									<tr>
										<td width="118" class="main_title_td_center">相关信息</td>
										<td align="right" class="main_title_td_bg">&nbsp;</td>

									</tr>
								</table>
								<table width="100%" border="0" cellspacing="0" rules="all"
									style="WIDTH: 100%; BORDER-COLLAPSE: collapse">
									<tr
										onmouseover="currentcolor=this.style.backgroundColor;this.style.backgroundColor='#f0f7ff'"
										onmouseout="this.style.backgroundColor=currentcolor">

										<td colspan=9 align="left" class="main_matter_td" height='30'>&nbsp;&nbsp;&nbsp;
											<%
												String puname = request.getParameter("uname")==null?"":request.getParameter("uname"); 
											String startuname = request.getParameter("startuname")==null?"":request.getParameter("startuname"); 
											String enduname = request.getParameter("enduname")==null?"":request.getParameter("enduname"); 
											String ptname = request.getParameter("tname")==null?"":request.getParameter("tname"); 
											String starttname = request.getParameter("starttname")==null?"":request.getParameter("starttname"); 
											String endtname = request.getParameter("endtname")==null?"":request.getParameter("endtname");
											%> <%
 	HashMap mmm = new HashMap();
 %> &nbsp;&nbsp;用户名 &nbsp;:&nbsp; <input
											type=text class='textBox' size=20 name='uname' />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
											&nbsp;&nbsp;姓名 &nbsp;:&nbsp; <input type=text class='textBox'
											size=20 name='tname' />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
											&nbsp;&nbsp;&nbsp;<input type=submit class='' value='查询信息' />
											&nbsp; &nbsp; &nbsp; <br />
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td height="6" colspan="2"></td>
						</tr>
						<tr>
							<td width="118" class="main_title_td_center">信息列表</td>
							<td class="main_title_td_bg">&nbsp;</td>
						</tr>
					</table>
					<table width="100%" border="0" cellspacing="0"
						style="WIDTH: 100%; BORDER-COLLAPSE: collapse">
						<tr
							onmouseover="currentcolor=this.style.backgroundColor;this.style.backgroundColor='#f0f7ff'"
							onmouseout="this.style.backgroundColor=currentcolor">
							<td align="center" class="main_title_td_center2">用户名</td>
							<td align="center" class="main_title_td_center2">密码</td>
							<td align="center" class="main_title_td_center2">姓名</td>
							<td align="center" class="main_title_td_center2">性别</td>
							<td align="center" class="main_title_td_center2">生日</td>
							<td align="center" class="main_title_td_center2">联系电话</td>
							<td align="center" class="main_title_td_center2">身份证号码</td>
							<td align="center" class="main_title_td_center2">操作</td>
						</tr>



						<%
							new CommDAO().delete(request,"sysuser"); 
						if(request.getParameter("unameid1")!=null){ 
						 new CommDAO().commOper("update sysuser set uname ='' where id="+request.getParameter("unameid1"));  
						} 
						if(request.getParameter("unameid2")!=null){ 
						 new CommDAO().commOper("update sysuser set uname ='' where id="+request.getParameter("unameid2"));  
						} 
						String sql = "select * from sysuser where 1=1 " ;
						 if(!puname.equals("")){ 
						 sql+= " and uname like'%"+puname+"%' " ;
						 }  
						 if(!startuname.equals("")){  
						 mmm.put("startuname",startuname) ;
						 sql+= " and uname >'"+startuname+"' " ;
						 }  
						 if(!enduname.equals("")){  
						 mmm.put("enduname",enduname) ;
						 sql+= " and uname <'"+Info.getDay(enduname,1)+"' " ;
						 }  
						 if(!ptname.equals("")){ 
						 sql+= " and tname like'%"+ptname+"%' " ;
						 }  
						 if(!starttname.equals("")){  
						 mmm.put("starttname",starttname) ;
						 sql+= " and tname >'"+starttname+"' " ;
						 }  
						 if(!endtname.equals("")){  
						 mmm.put("endtname",endtname) ;
						 sql+= " and tname <'"+Info.getDay(endtname,1)+"' " ;
						 }  
						  sql +="  and (1!=1 " ; 
						  sql +="  or  utype like'%会员%' " ;
						  sql +="  ) ";
						  sql +=" order by id desc ";
						String url = "members.jsp?1=1&uname="+puname+"&tname="+ptname+""; 
						ArrayList<HashMap> list = PageManager.getPages(url,5, sql, request ); 
						for(HashMap map:list){
						%>
						<tr
							onmouseover="currentcolor=this.style.backgroundColor;this.style.backgroundColor='#f0f7ff'"
							onmouseout="this.style.backgroundColor=currentcolor">

							<td align="center" valign="middle" class="main_matter_td"><%=map.get("uname")%></td>
							<td align="center" valign="middle" class="main_matter_td"><%=map.get("upass")%></td>
							<td align="center" valign="middle" class="main_matter_td"><%=map.get("tname")%></td>
							<td align="center" valign="middle" class="main_matter_td"><%=map.get("sex")%></td>
							<td align="center" valign="middle" class="main_matter_td"><%=map.get("birth")%></td>
							<td align="center" valign="middle" class="main_matter_td"><%=map.get("linkphone")%></td>
							<td align="center" valign="middle" class="main_matter_td"><%=map.get("sfid")%></td>
							<td align="center" valign="middle" class="main_matter_td"><a
								href="mupdateuser.jsp?id=<%=map.get("id")%>">修改</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a
								onclick="return confirm('确定要删除这条记录吗?')"
								href="members.jsp?scid=<%=map.get("id")%>">删除</a>
							</td>
						</tr>
						<%
							}
						%>





						<tr
							onmouseover="currentcolor=this.style.backgroundColor;this.style.backgroundColor='#f0f7ff'"
							onmouseout="this.style.backgroundColor=currentcolor">
							<td colspan=9 height="15" align="center" valign="middle"
								class="main_matter_td">${page.info}</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</form>
</body>
</html>
<script language=javascript src='/shhouse/js/ajax.js'></script>
<%
	mmm.put("uname",puname); 
mmm.put("tname",ptname);
%>
<%=Info.tform(mmm)%>
<script language=javascript>  
 
</script>
<%=Info.tform(mmm)%>
<script language=javascript
	src='/shhouse/js/My97DatePicker/WdatePicker.js'></script>
<script language=javascript src='/shhouse/js/popup.js'></script>
<script language=javascript> 
function update(no){ 
pop('mupdateuser.jsp?id='+no,'信息修改',550,280) 
}
</script>
<script language=javascript> 
function add(){ 
pop('madduser.jsp','信息添加',550,280) 
}
</script>
<%@page import="util.Info"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.HashMap"%>
<%@page import="util.PageManager"%>
<%@page import="dao.CommDAO"%>
